package com.myacg.platform.living;

import java.awt.Graphics;

import com.myacg.core.entity.Point;
import com.myacg.platform.view.stage.Stage;

public abstract class StaticLiving implements Living{
	protected   String id;	//
	protected Point point;  //实时坐标
	protected Stage parent; //父容器。 
	protected StaticLiving(Point point){
		this.point=point;
	}
	@Override
	public abstract void drawSelf(Graphics g);
	//当自己被销毁时触发的方法
	public abstract void whenOver();
	
	
	@Override
	public void distoraySelf() {
		this.parent.removeLiving(this);
		this.whenOver(); // 执行回调方法
	}

	@Override
	public String getId() {
		return this.id;
	}
	@Override
	public void setId(String id) {
		this.id=id;
	}
	@Override
	public void setParent(Stage stage) {
			this.parent=stage;
	}
	@Override
	public Stage getParent() {
		return this.parent;
	}

}
